import base from './baseapi'
import wepy from 'wepy';
import Tips from '../utils/Tips';


/**
 * 微页面，主页API接口数据
 */
export default class myorderApi extends base {


    ///获取会员中心信息
    static async GetMemberCenterInfo(params) {
        //let data={index:"index",rand:`${Math.random()}`};
        let res = await this.get('vshop', 'Member/GetMemberCenterInfo', params);
        return res;
    }


    ///获取订单列表
    static async GetOrderList(params) {
        //let data={index:"index",rand:`${Math.random()}`};
        let res = await this.get('vshop', 'Order/GetOrderList', params);
        return res;
    }

      // 获取订单详情
      static async GetOrderInfo(params) {
        let res = await this.get('vshop', 'Order/GetOrderInfo', params);
        return res;
    }

      // 通过包裹Id获取包裹物流轨迹信息
      static async GetExpTrack(params) {
        let res = await this.get('vshop', 'Order/GetExpTrack', params);
        return res;
    }

    // 通过订单号获取包裹列表
    static async GetPackageList(params) {
        let res = await this.get('vshop', 'Order/GetPackageList', params);
        return res;
    }

    //同步微信资料信息
    static async ChangeMemberInfo(params) {
        let res = await this.postForm('vshop', 'Member/ChangeMemberInfo',params);
        return res;
    }
     //取消订单
     static async CancelMyOrder(params) {
      let res = await this.postForm('vshop', 'Order/CancelOrder',params);
      return res;
    }
    //获取维权订单列表
    static async RightsOrderList(params) {
      let res = await this.get('vshop', 'RightsOrder/GetOrderList',params);
      return res;
    }
    //申请维权订单信息获取
    static async GetRightsOrderProduct(params) {
      let res = await this.postJson('vshop', 'RightsOrder/GetRightsOrderProduct',params);
      return res;
    }
    // 上传维权图片
    static async UploadCommentImage(filePath,formData) {
      let res = await this.postFile('vshop', 'RightsOrder/UploadRightsImage', filePath,formData);
      return res;
    }

    // 删除维权图片
    static async DelPic(params) {
      let res = await this.postForm('vshop', 'RightsOrder/DelPic',params);
      return res;
    }
    //创建维权订单
    static async CreateRightsOrder(params) {
      let res = await this.postJson('vshop', 'RightsOrder/CreateRightsOrder',params);
      return res;
    }
    //获取维权订单详情
    static async GetOrderDetails(params) {
      let res = await this.get('vshop', 'RightsOrder/GetOrderDetails',params);
      return res;
    }
    //获取收货地址
    static async GetDefaultAddress(params) {
      let res = await this.get('vshop', 'RightsOrder/GetDefaultAddress',params);
      return res;
    }
    //获取物流公司
    static async GetCommonExpressList(params) {
      let res = await this.get('vshop', 'RightsOrder/GetCommonExpressList',params);
      return res;
    }
    //寄快递
    static async SendBack(params) {
      let res = await this.postJson('vshop', 'RightsOrder/SendBack',params);
      return res;
    }
    //取消维权订单
    static async CancelOrder(params) {
      let res = await this.postForm('vshop', 'RightsOrder/CancelOrder',params);
      return res;
    }
    //获取退款协商记录
    static async GetOrderLog(params) {
      let res = await this.get('vshop', 'RightsOrder/GetOrderLog',params);
      return res;
    }
    //通过推广码获取优惠券信息
    static async GetCouponInfo(params) {
      let res = await this.get('vshop', 'Coupon/GetCouponInfo',params);
      return res;
    }
    //领取优惠券
    static async TakeCoupon(params) {
      let res = await this.postForm('vshop', 'Coupon/TakeCoupon',params);
      return res;
    }
    // 校验优惠券状态
    static async CheckCouponStatus(params) {
      let res = await this.postJson('vshop', 'Coupon/CheckCouponStatus',params);
      return res;
    }
    //检查选择商品是否支持维权操作
    static async CheckRightsOrderProduct(params) {
      let res = await this.postJson('vshop', 'RightsOrder/CheckRightsOrderProduct',params);
      return res;
    }   
}
